using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using BUS;

namespace Presentation
{
    public partial class BM61GUI : Form
    {
        public BM61GUI()
        {
            InitializeComponent();
        }

        public void ShowMaster(List<String> TenDuong,List<int> Sokm,List<int> ThoiGianDung)
        {
            for (int i = 0; i < TenDuong.Count; i++)
            {
                dgvQuangDuong.Rows.Add((i+1).ToString(), TenDuong[i].ToString(), Sokm[i].ToString(), (10 * Sokm[i]).ToString());
            }
        }

        private void BM63GUI_Load(object sender, EventArgs e)
        {
            this.cbBienSo.ValueMember = "BienSo";
            this.cbBienSo.ValueMember = "BienSo";
            this.cbBienSo.DataSource = XeBUS.SelectXeAll();
        }

        private void Load_Click(object sender, EventArgs e)
        {
            dgvQuangDuong.DataSource = null;
            dgvQuangDuong.Rows.Clear();
            if (this.tbThang.Text == null) return;
             int thang = int.Parse(this.tbThang.Text); 
             String bienso = this.cbBienSo.SelectedValue.ToString();
             List<String> TenDuong=new List<string>();
             List<int> QuangDuong=new List<int>();
             List<int> ThoiGianDung=new List<int>();
             XeBUS.TimQuangDuongTheoThang(bienso, thang, TenDuong, QuangDuong, ThoiGianDung);
             ShowMaster(TenDuong, QuangDuong, ThoiGianDung);
                        
            
        }

        //private void Load_Click(object sender, EventArgs e)
       // {
            //if (this.tbThang.Text == null) return;
           // int thang = int.Parse(this.tbThang.Text.ToString()); ;
           // String bienso = this.cbBienSo.SelectedItem.ToString();
           // MessageBox.Show(bienso);
       // }
    }
}